package com.mcode.blog.controller;

import com.mcode.blog.service.LoginService;
import com.mcode.blog.vo.Result;
import com.mcode.blog.vo.params.LoginParams;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("register")
@RestController
public class RegisterController {

    @Resource
    private LoginService loginService;


    /**
     * 注册
     * @param loginParams
     * @return
     */
    @PostMapping
    public Result register(@RequestBody LoginParams loginParams) {
        String token = loginService.register(loginParams);
        return Result.success(token);
    }


}
